home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat2 / pfork.nr < prev    next >
Encoding:
Text File  |  1993-03-03  |  1.5 KB  |  67 lines

  1.  
  2.  
  3.  
  4. Pfork(2)                   Oct. 1, 1991                  Pfork(2)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        Pfork - create a copy of the current process
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        WORD Pfork();
  12.  
  13. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  14.        _✓P_✓f_✓o_✓r_✓k  creates  a  copy  of the current process. The child
  15.        (the new process created) inherits a copy of the  parent's
  16.        address  space,  not  the parent's original memory, and so
  17.        changes to variables in the child do not affect the parent
  18.        in  any  way.   The  new  process begins execution with an
  19.        apparent return from the _✓P_✓f_✓o_✓r_✓k call.
  20.  
  21. R✓RE✓ET✓TU✓UR✓RN✓NS✓S
  22.        0 in the child
  23.  
  24.        The new process id (a positive number), in the parent.
  25.  
  26.        ENSMEM if there is not enough memory  to  create  the  new
  27.        process.
  28.  
  29. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  30.        _✓P_✓e_✓x_✓e_✓c(2), _✓P_✓v_✓f_✓o_✓r_✓k(2)
  31.  
  32. B✓BU✓UG✓GS✓S
  33.        If  the  parent  is  in  supervisor mode when this call is
  34.        made, the child will be started in user mode anyway; thus,
  35.        it  is  strongly  recommended  that this call be made only
  36.        from user mode.
  37.  
  38.        The current implementation of _✓P_✓f_✓o_✓r_✓k acts  like  _✓P_✓v_✓f_✓o_✓r_✓k  in
  39.        that  the parent is suspended until the child either exits
  40.        or overlays itself with _✓P_✓e_✓x_✓e_✓c mode 200.  Do  not  rely  on
  41.        this behavior, as it will be changed in future versions of
  42.        MiNT.
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. Version 0.9          MiNT Programmer's Manual                   1
  65.  
  66.  
  67.